﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SportsPlatform.Base;
using SportsPlatform.Filters;
using SportsPlatform.Query.SportBusiness.Feedback;
using SportsPlatform.SportBusiness.ISportBusiness;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SportsPlatform.Controllers
{
    /// <summary>
    /// 意见反馈控制器
    /// </summary>
    [ActionAuthorization]
    [Route("api/[controller]/[action]")]
    public class FeedbackController : SportsPlatformControllerBase
    {
        private IFeedbackService _feedbackService;

        public FeedbackController(IFeedbackService feedbackService)
        {
            _feedbackService = feedbackService;
        }

   

        /// <summary>
        /// 获取分页后的意见反馈数据
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PagePagingDto<FeedbackDto>> GetFeedbackPage([FromBody] GetFeedbackQuery query)
        {
            return await _feedbackService.GetFeedback(query);
        }
    }
}
